import useNumbers from "./useNumbers";
import useRecordRTC from "./useRecordRTC";

export const useOperate = () => {
  const router = useRouter();
  const scan = () => {
    console.log("扫一扫");
    router.push("/scan");
  };

  const record = () => {
    const { toggleRecord } = useRecordRTC();
    toggleRecord();
    console.log("录音");
  };

  const merge = () => {
    console.log("合并");
    const { sortResNumbers } = useNumbers();
    sortResNumbers();
  };

  return {
    scan,
    record,
    merge
  };
};
